package com.viknix.threadpool.manager.client.listener;

import java.util.concurrent.Executor;

/**
 * @Author: Dongqi
 * @Date: 2021/11/24 14:52
 * @Version 1.0
 * @Description:
 */
public abstract class AbstractSharedListener implements Listener {

    private volatile String poolId;
    private volatile String item;

    public final void fillContext(String poolId, String item) {
        this.poolId = poolId;
        this.item = item;
    }

    @Override
    public final void receiveConfigInfo(String configInfo) {
        innerReceive(poolId, item, configInfo);
    }

    @Override
    public Executor getExecutor() {
        return null;
    }

    /**
     * receive
     *
     * @param dataId     data ID
     * @param group      group
     * @param configInfo content
     */
    public abstract void innerReceive(String dataId, String group, String configInfo);
}
